import React, { Component } from 'react'
import { connect } from 'dva'
class Home extends Component {
  render () {
    console.log(this.props)
    return (
      <div>
        数据是：{this.props.home.num}
        <button onClick={e => this.props.dispatch({type:'home/changeNum', payload: {num:8, name: 'zs', age: 18}})}>更改数据</button>
      </div>
    )
  }
}
export default connect(state => {
  return {
    home: state.home
  }
})(Home)